#ifndef HPLC_ZKYS_CHECKPACKET_H
#define HPLC_ZKYS_CHECKPACKET_H

#include "hplczkyssendcommonpacket.h"

namespace hplc
{
namespace zkys
{

class HplcZkysProtocolCommonData;
class HplcZkysCheckPacket : public QObject
{
    Q_OBJECT

public:
    HplcZkysCheckPacket(HplcZkysProtocolCommonData &data, QObject *parent = nullptr);
    ~HplcZkysCheckPacket();

    virtual void replyCheck(char *data);

    HplcZkysSendCommonPacket *getSender();

    void sendRetry();
    void sendNoRetry();

    void ack2Send();
    void resetTickCheck();

public slots:
    void onRetryTimeout();
    void onTickCheckTimeout();
    void onBaseTickTimeout();

signals:
    void errorPacket();
    void lostPacket();
    void lostTick();

protected:
    HplcZkysProtocolCommonData *m_d;
};

} // zkys
} // hplc


#endif // HPLC_ZKYS_CHECKREPLYPACKET_H
